package com.tm.utils;

import lombok.Data;

import java.util.Calendar;
import java.util.Date;

/**
 * @author huangp
 * @create 2023-04-19 19:34
 */
public class DateUtils {

    public static Date calendarDate(Date date,int num,int dateUnit){

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(Calendar.DATE,num);
        Date time = calendar.getTime();
        return time;
    }

    public static void main(String[] args) {
        Date date = calendarDate(new Date(), 1, Calendar.YEAR);
        System.out.println(date);
    }

}
